package com.woniuxy.springboot.mybatis.controller;

import com.woniuxy.springboot.mybatis.pojo.Dept;
import com.woniuxy.springboot.mybatis.service.DeptService;
import com.woniuxy.springboot.mybatis.util.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeptController {
    @Autowired
    private DeptService deptService;
    @ApiOperation("增加部门")
    @PostMapping(value = "/depts")
    public R addDept(Dept dept){
        boolean flag = deptService.addDept(dept);
        if(flag){
            return R.ok();
        }else{
            return R.error();
        }
    }
}
